/*
 * Copyright (C) 2025 ameise <ameise.wang@gmail.com> - All Rights Reserved
 *
 * This file is part of e3time.
 *
 * e3time is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * e3time is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with e3time. If not, see <https://www.gnu.org/licenses/>.
 */

package main

import (
	"fmt"
	time "gitee.com/ameise84/e3time"
	"log"
)

func main() {
	fmt.Println("---TestTime---")
	now1 := time.Now()
	log.Printf("now1:%s\n ", now1.Format(time.LayoutMs))
	now2 := now1.Add(20 * time.Second)
	log.Printf("now2:%s\n", now2.Format(time.LayoutMs))
	if err := time.FastForwardToLocal(now2.Format(time.LayoutMs)); err != nil {
		log.Println(err)
	}
	now3 := time.Now()
	log.Printf("now3:%s\n", now3.Format(time.LayoutMs))
	now4 := time.Unix(now3.Unix()+10, 0)
	log.Printf("now4:%s\n", now4.Format(time.LayoutMs))
	log.Printf("now4:%s\n", now4.UTC().Format(time.LayoutMs))
	if err := time.FastForwardToUTC(now4.UTC().Format(time.LayoutMs)); err != nil {
		log.Println(err)
	}
	now5 := time.Now()
	log.Printf("now5:%s\n", now5.Format(time.LayoutMs))
}
